package com.company.pddpre09;

import java.util.Arrays;
import java.util.Scanner;

public class Main4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] feature = new int[M];
        for (int i = 0; i < M ; i++) {
            feature[i] = sc.nextInt();
        }
        int res = getFeatureNum(feature,N,M);
        System.out.println(res);

    }

    private static int getFeatureNum(int[] feature, int n, int m) {
        int minGcd = 1;
        if(m == 1) {
            int ret = 0;
            for (int i = feature[0]; i <= n; i += feature[0]) {
                ret++;
            }
            return ret;
        }

        minGcd= feature[0];
        for(int i = 1;i < m;i++){
            minGcd = gcd(feature[i],minGcd);
        }
        if(minGcd != 1){
            int ret = 0;
            for (int k = minGcd; k <= n; k += minGcd) {
                ret++;
            }
            return ret;
        }

        int[] count = new int[n+ 1];
        int res = 0;
        Arrays.sort(feature);
        for(int i = 0;i < m;i++){
            int yinzi = feature[i];
            for(int j = yinzi;j <= n;j+= yinzi){
                if(count[j] == 1){
                    continue;
                }else{
                    count[j] = 1;
                    res++;
                }
            }
        }
//        int res = 0;
//        for(int i = 0;i <= n;i++){
//            if(count[i] == 1){
//                res++;
//            }
//        }

        return res;
    }

    private static int gcd(int a,int b){
        while(b != 0){
            int temp = a;
            a = b;
            b = temp % b;
        }
        return a;
    }
//
//    private static int mcd(int a,int b){
//        return a * b / gcd(a,b);
//    }


}
